安装
- 官网下载:http://valgrind.org/downloads/current.html#current
1
2
3
4
5
6
7
8
9
10tar -jxf valgrind-3.12.0.tar.bz2
cd valgrind-3.12.0
vim README
./autogen.sh
./configure --prefix=安装目录
make
make indstall
验证是否安装成功
cd 安装目录/bin
./valgrind ls -l
检测内存泄露
./valgrind –tool=memcheck –leak-check=full ./某某文件
输出信息
memcheck
可能的内存泄露(Possibly lost)
确定的内存泄露(Definitely lost)